﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Trans.car
{
    public partial class Select_cartype : Form
    {
        public Select_cartype()
        {
            InitializeComponent();
        }
        public int Id
        {
            get{
                return (int)gv_cartype.SelectedRows[0].Cells["c_id"].Value;
            }
        }
        public string Model
        {
            get{
                return (string)gv_cartype.SelectedRows[0].Cells["c_model"].Value;
            }
        }
        public bool HasSelected
        {
            get{
                return gv_cartype.SelectedRows.Count > 0;
            }
        }
        private void Select_cartype_Load(object sender, EventArgs e)
        {
            
            this.tb_cartypeTableAdapter.Fill(this.dataSet.tb_cartype);

        }

        private void bt_cancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void bt_ok_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void gv_cartype_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
        {
            session.Color_Const.set_gv_color(gv_cartype);
        }


    }
}
